<template>
  <div class="time">{{ time }}</div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import dayjs from 'dayjs'

type Props = {
  t: number
}

const props = defineProps<Props>()

const covertTime = (t: number): string => {
  if (!t) return ''

  return dayjs(t).format('HH:mm')
}

const time = ref(covertTime(props.t))
</script>

<style lang="less" scoped>
@timeColor: rgba(180, 180, 180, 1);
.time {
  line-height: 1;
  text-align: right;
  font-size: 10px;
  color: @timeColor;
}
</style>
